package com.lesserpand.springcloudalibabaprovider;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ADMIN
 */
@SpringBootApplication
@EnableDiscoveryClient
@MapperScan(basePackages = {"com.lesserpand.springcloudalibabaprovider.**.*.dao"})
public class SpringCloudAlibabaProviderApplication {

    private static final Logger LOGGER = LoggerFactory.getLogger(SpringCloudAlibabaProviderApplication.class);

    public static void main(String[] args) {
        SpringApplication.run(SpringCloudAlibabaProviderApplication.class, args);
    }

    @RestController
    class EchoController {
        @RequestMapping(value = "/echo/{string}", method = RequestMethod.GET)
        public String echo(@PathVariable String string) {
            LOGGER.info("asdf");
            return "Hello Nacos Discovery " + string;
        }
    }
}
